#!/bin/sh
# Job yaml can send below ENVIRONMENT VARIABLES to me
# - services
# END ENVIRONMENT VARIABLES

[ -z "$services" ] && exit

post_script=$TMP_RESULT_ROOT/post-run.stop_service

for service in $services; do
	if systemctl is-active "$service" >/dev/null; then
		systemctl stop "$service"
		echo "systemctl start $service" >> "$post_script"
	fi
done
